package src;

import java.io.*;

public class IOResults {
	public static void duQu(String dizhi) throws Exception {
		FileReader fileReader = new FileReader(dizhi);
		int length = 0;
		String str = "";
		while ((length = fileReader.read()) != -1) {
			str += (char) length;
		}
		System.out.println(str);
		fileReader.close();
	}

	public static void shanChu(String fileName) {
		File file = new File(fileName);
		try {
			if (!file.exists()) {
				file.createNewFile();
			}
			FileWriter fileWriter = new FileWriter(file);
			fileWriter.write("");
			fileWriter.flush();
			fileWriter.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) throws Exception {

		shanChu("D:\\我 1\\作业（大二上）\\java\\java实验\\java实验六\\src\\src\\xuanke.txt");

	}

}